<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
    <head>
        <link href="/library/skin/tool_base.css" type="text/css" rel="stylesheet" media="all" />
        <link href="/mailsender-tool/content/css/MailSender.css" type="text/css" rel="stylesheet" media="all" />
        <script src="/library/js/headscripts.js"></script>
    </head>
    <body>
        <div class="portletBody">
            <div id="menu" th:include="fragments/menus :: main (options)" />
                <div th:if="${error != null}" th:text="${error}" class="sak-banner-error"/>
                <form id="optionsForm" method="post" class="form-horizontal" >
                    <div class="page-header">
                        <h1 th:text="#{options_toolbar}">Options</h1>
                    </div>
                    <div th:text="#{options_instruction}" class="instruction section">
                    You are currently choosing options for Email. Settings chosen on this page will become the default settings for this site.
                    </div>

                    <div class="section form-group">
                        <div class="optionsheaderkeyholder col-sm-4 ">
                            <span th:text="#{options_copies}" class="headerkey control-label">Copies:</span>
                        </div>
                        <div class="optionsheadervalue col-sm-8">
                            <div class="option-checkbox">
                                <input  id="sendMeACopy" name="sendMeACopy" value="true" type="checkbox" th:attrappend="checked=${config.isSendMeACopy() == true}?@{checked}" />
                                <label th:text="#{sendmeacopy}" for="sendMeACopy">Send me a copy</label>
                            </div>
                            <div  id="addToArchiveDiv" class="option-checkbox">
                                <input id="addToArchive" name="addToArchive" type="checkbox" value="true" th:attrappend="checked=${config.isAddToArchive() == true}?@{checked}" />
                                <label th:text="#{addtoemailarchive}" for="addToArchive">Add to Email Archive, visible to all site participants</label>
                            </div>
                        </div>
                    </div>
                    <div class="section form-group">
                        <div class="optionsheaderkeyholder col-sm-4">
                            <span th:text="#{options_show_recipients}" class="headerkey control-label">Show Recipients:</span>
                        </div>
                        <div class="optionsheadervalue col-sm-8">
                            <div class="option-checkbox">
                                <input id="appendRecipientList" name="appendRecipientList" value="true" type="checkbox" th:attrappend="checked=${config.isAppendRecipientList() == true}?@{checked}"/>
                                <label th:text="#{appendrecipientlist}" for="appendRecipientList">Append list of recipients to message</label>
                            </div>
                        </div>
                    </div>
                    <div class="section form-group">
                        <div class="optionsheaderkeyholder col-sm-4">
                            <span th:text="#{replyto}" class="headerkey control-label">Reply-to:</span>
                        </div>
                        <div class="optionsheadervalue col-sm-8">
                            <span id="replyToSelect" />
                            <div>
                                <input id="replyToSender" type="radio" name="replyto"  value="yes" th:attrappend="checked=${#strings.equals(config.getReplyTo(),'sender')}?@{checked}" />
                                <label id="replyToSenderLabel" for="replyToSender">Sender</label>
                                <br/>
                                <input id="replyToNone" type="radio" name="replyto" value="no" th:attrappend="checked=${#strings.equals(config.getReplyTo(),'no_reply_to')}?@{checked}"/>
                                <label id="replyToNoneLabel" for="replyToNone">Do not allow reply</label>
                            </div>
                        </div>
                    </div>
                    <div class="section form-group">
                        <div class="optionsheaderkeyholder col-sm-4">
                        <span th:text="#{options_displayinvalidemails}" class="headerkey optionsHeaderKey control-label">Display invalid emails:</span>
                        </div>
                        <div class="optionsheadervalue col-sm-8">
                            <span id="invalidEmailsSelect" />
                            <div>
                                <input id="invalidEmailsYes" type="radio" name="InvalidEm" value="true" th:attrappend="checked=${config.isDisplayInvalidEmails() == true}?@{checked}" />
                                <label id="invalidEmailsYesLabel" for="invalidEmailsYes">Yes</label>
                                <br/>
                                <input id="invalidEmailsNo" type="radio" name="InvalidEm" value="false" th:attrappend="checked=${config.isDisplayInvalidEmails() == false}?@{checked}" />
                                <label id="invalidEmailsNoLabel" for="invalidEmailsNo" >No</label>
                            </div>
                        </div>
                    </div>
                    <div class="section form-group">
                        <div class="optionsheaderkeyholder col-sm-4">
                            <span th:text="#{options_displayemptygroups}" class="headerkey optionsHeaderKey control-label">Display empty recipient groups:</span>
                        </div>
                        <div class="optionsheadervalue col-sm-8">
                            <span id="emptyGroupsSelect" />
                            <div>
                                <input id="emptyGroupsYes" type="radio" name="rcpsempty" value="true" th:attrappend="checked=${config.isDisplayEmptyGroups() == true}?@{checked}" />
                                <label id="emptyGroupsYesLabel" for="emptyGroupsYes">Yes</label>
                                <br/>
                                <input id="emptyGroupsNo" type="radio" name="rcpsempty" value="false" th:attrappend="checked=${config.isDisplayEmptyGroups() == false}?@{checked}" />
                                <label id="emptyGroupsNoLabel" for="emptyGroupsNo">No</label>
                            </div>
                        </div>
                    </div>
                    <div th:if="${prefix==true}" id="subjectPrefixDiv" class="section form-group"  >
                        <div class="optionsheaderkeyholder col-sm-4">
                                        <span th:text="#{options_subjectprefix}" class="headerkey control-label">Subject Prefix:</span>
                        </div>
                        <div class="optionsheadervalue col-sm-8">
                            <span id="subjectPrefixSelect" />
                            <div>
                                <input id="subjectPrefixDefault" type="radio" value="system" name="prefix" onclick="jQuery('#customPrefixDiv').hide()" th:attrappend="checked=${#strings.equals(config.getSubjectPrefixType(),'system')}?@{checked}" />
                                <label id="subjectPrefixDefaultLabel" for="subjectPrefixDefault">Use the default prefix (%site_title%: )</label>
                                <br/>
                                <input id="subjectPrefixCustom" type="radio" name="prefix" value="custom" onclick="jQuery('#customPrefixDiv').show()" th:attrappend="checked=${#strings.equals(config.getSubjectPrefixType(),'custom')}?@{checked}" />
                                <label id="subjectPrefixCustomLabel" for="subjectPrefixCustom">Use a custom prefix</label>
                                <br/>
                                <div id="customPrefixDiv" th:style="${#strings.equals(config.getSubjectPrefixType(),'system') ? 'display:none':'display:block'}">
                                    <span th:text="#{options_customprefix}" />
                                    <input th:value="${config.getSubjectPrefix()}" id="subjectPrefix" name="subjectPrefix" size="15" />
                                </div>
                                <span th:text="#{options_customprefixnote}" />
                            </div>
                        </div>
                    </div>
                    <div class="section">
                        <p class="act section">
                            <input id="update-button" name="update" value="Update Defaults" class="active" type="submit" />
                            <input id="cancel-button" name="cancel" value="Cancel" type="submit" />
                        </p>
                    </div>
                </form>
            <div class="cleaner" />
        </div>
    </body>
</html>
